package cn.bossfriday.im.common.constant;

import cn.bossfriday.common.exception.ServiceRuntimeException;

/**
 * ImConstant
 *
 * @author chenx
 */
public class ImConstant {

    private ImConstant() {
        // do nothing
    }

    /**
     * Global
     */
    public static final String BASE_PACKAGE_NAME = "cn.bossfriday";
    public static final String DEFAULT_APP_KEY = "4UKeB5wgkzxzv1K1j";
    public static final String DEFAULT_APP_SECRET = "WLYIRU6gHwhUv2";

    /**
     * Qos
     */
    public static final int QOS_AT_MOST_ONCE = 0;
    public static final int QOS_AT_LEAST_ONCE = 1;
    public static final int QOS_EXACTLY_ONCE = 2;

    /**
     * Service Name
     */
    public static final String SERVICE_NAME_FILE = "FileSrv";
    public static final String SERVICE_NAME_ACCESS = "AccessSrv";
    public static final String SERVICE_NAME_API = "ApiSrv";
    public static final String SERVICE_NAME_USER = "UserSrv";

    /**
     * Cache
     */
    public static final int CACHE_DEFAULT_INITIAL_CAPACITY = 1000;
    public static final int CACHE_DEFAULT_MAXIMUM_SIZE = 50000;
    public static final int CACHE_EXPIRE_ONE_MINUTE = 60;
    public static final int CACHE_EXPIRE_TEN_MINUTE = 600;
    public static final int CACHE_EXPIRE_TWO_HOURS = 7200;

    /**
     * Actor
     */
    public static final String ACTOR_API_ACK = "apiAck";
    public static final String ACTOR_API_GET_ACCESS_ADDRESS_ACK = "getAccessAddressAck";

    public static final String ACTOR_USER_GET_TOKEN = "getToken";

    public static final String ACTOR_ACCESS_GET_ACCESS_ADDRESS = "getAccessAddress";

    /**
     * Exception
     */
    public static final ServiceRuntimeException EXCEPTION_APP_NOT_EXISTED = new ServiceRuntimeException("App Not Existed!");
    public static final ServiceRuntimeException EXCEPTION_APP_INVALID = new ServiceRuntimeException("App Invalid!");
}
